package com.gitee.luosl.cola.lang.function.checked;

import java.util.function.ToDoubleFunction;

public interface CheckedToDoubleFunction<T> {
    
    double applyAsDouble(T value) throws Throwable;

    default ToDoubleFunction<T> asToDoubleFunction(){
        return i -> {
            try {
                return applyAsDouble(i);
            }catch (Throwable throwable){
                throw new CheckedException(throwable);
            }
        };
    }
}
